<template>
    <div>
        <el-form v-loading="loading">
            <el-form-item v-for="(question,index) in wrong_question_list" :key="index" class="q">
                <p style="color: red;">{{question.name}}</p>
                <el-radio-group v-if="question.type in {'SINGLE_CHOICE':'','JUDGE':''}" disabled>
                    <el-radio v-for="(option,index) in question.optionList" :key="index" :label="option.id">{{ option.content }}</el-radio>
                </el-radio-group>

                <el-checkbox-group v-if="question.type=='MULTIPE_CHOICE'" disabled>
                    <el-checkbox
                    v-for="(option,index) in question.optionList"
                    :key="index"
                    :label="option.id">{{ option.content }}</el-checkbox>
                </el-checkbox-group>
            </el-form-item>
        </el-form>
        <!-- <el-backup></el-backup> -->
    </div>
</template>
<script>
import { stom_collections } from "@/api/question_bank"
import { get_wrong_question_list } from "@/api/user"

export default{
    name: 'wrongBook',
    data(){
        return {
            loading: false,
            wrong_question_list: [],
            idList:[]
        }
    },
    methods:{
        
    },
    mounted(){
        this.loading = true
        get_wrong_question_list().then(res =>{
            // console.log(res);
            for(let i=0;i<res.data.length;i++){
                this.idList.push(res.data[i].questionId)
            }
            stom_collections({idList:this.idList}).then(res =>{
                // console.log(res)
                this.wrong_question_list = res.data.data;
                this.loading = false;
            })
        })
    }
}
</script>
<style scoped>
.el-form-item.q{
    text-align: left;
}
</style>